<template>
    <div>
        <van-nav-bar id="reset" title="购买记录" left-arrow @click-left="backHandle" fixed z-index="100" />

        <div class="pageCon fuPage">
            <div class="listBox">
                <div class="listMain">
                    <template v-if="historyList.length != 0">
                        <div class="itemBox" v-for="( item, index ) in  historyList " :key="index">
                            <div class="line1">
                                <span><span>订单编号：</span> {{ item.orderNumber }} </span>
                                <span>金额：{{ item.orderTotal }}</span>
                            </div>
                            <div>
                                <span>购买{{ item.orderType == 1 ? '亲情就诊次数' : item.orderType == 2 ? '家庭套餐' : '加号次数'
                                    }}</span>
                                <span>{{ item.createTime }}</span>
                            </div>
                        </div>
                    </template>
                    <div class="emptyBox" v-else>
                        <img src="../../assets/tip_content.png">
                    </div>
                </div>
            </div>
        </div>



    </div>

</template>

<script>
import { listMyApply } from '../../network/user'
export default {
    name: 'HomeR',
    data() {
        return {


            historyList: [],


        }
    },
    mounted() {

    },
    methods: {



        backHandle() {
            this.$router.back()
        },

        getList() {

            listMyApply({
                userId: localStorage.userId,
            }).then(res => {
                if (res.flag) {
                    this.isLoading = false
                    res.data = res.data.filter(item => {
                        return item.orderType == 2
                    })

                    this.historyList = res.data

                    console.log(this.historyList);
                }
            })

        },



    },
    created() {
        this.getList()
    },
    //计算属性
    computed: {

    },
    filters: {

    },
    watch: {
    }

}

</script>

<style lang='less' scoped>
.pageCon {

    padding: 112px 20px 0 !important;
    box-sizing: border-box;
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #EEF1F7;
    overflow: hidden;
}


.listBox {
    width: 100%;
    height: 100%;
    // background: #fff;
    border-radius: 20px;
    box-shadow: 0px 2px 6px 0px rgba(51, 51, 51, 0.08);
    overflow-y: scroll;
}


.listTop {
    position: sticky;
    top: 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 30px 34px 10px 44px;
    width: 100%;
    font-family: Source Han Sans CN;
    font-weight: 500;
    font-size: 28px;
    color: #333333;
    background: #fff;
    border-radius: 20px;
}

.listTop>div>span:nth-child(2) {
    margin-left: 30px;
    color: #999999;
}

.itemBox {
    margin-bottom: 20px;
    box-sizing: border-box;
    padding: 44px 30px 44px 44px;
    width: 100%;
    background: #fff;
    box-shadow: 0px 2px 6px 0px rgba(51, 51, 51, 0.08);
    border-radius: 20px;
    border-bottom: 2px solid #f2f2f2;
}

.itemBox>div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-family: Source Han Sans CN;
    font-weight: 400;
    font-size: 28px;
    color: #333333;
    line-height: 38px;

}

.itemBox>div:nth-child(2) {
    justify-content: space-between;
}

.itemBox>div:nth-child(3) {
    margin-top: 12px;
}

.itemBox>div:nth-child(3)>span:last-child {
    font-size: 24px;
    color: #999999;
}

#reset /deep/ .van-nav-bar__left .van-nav-bar__text,
#reset /deep/ .van-nav-bar__left .van-icon {
    color: #333 !important;
}

.emptyBox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.emptyBox>img {
    margin-top: 400px;
    width: 374px;
    height: 314px;
}

.applyRes {
    margin-top: 12px;
    justify-content: start !important;
    font-size: 24px !important;
    color: #666 !important;
}

.applyRes>span {
    color: #333 !important;
}


.passRea {
    padding-top: 24px;
    border-top: 1px solid #f2f2f2;
    font-size: 28px !important;
    color: #999 !important;
}

.btnBox {
    margin-top: 24px;
    display: flex;
    align-items: center !important;
    justify-content: flex-end !important;

    width: 100%;
}

.imgBox {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    padding-top: 24px;
    border-top: 1px solid #f2f2f2;
    width: 100%;
}

.imgBox>span {
    font-size: 28px;
    color: #999;
}

.imgBox>div>img {
    margin: 16px 16px 16px 0;
    width: 100px;
    height: 100px;
    // background: aqua;
    border-radius: 16px;
}


.resColor {
    color: #F56C6C !important;
}

.passColor {
    color: #67C23A !important;
}

.applyBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 136px;
    height: 48px;
    border-radius: 24px;
    border: 1px solid rgba(27, 178, 106, .5);
    font-family: Source Han Sans CN;
    font-weight: bold;
    font-size: 20px;
    color: #1BB26A !important;
}

.orderNumTip {
    margin-bottom: 12px;
    width: 100%;
    font-size: 24px;
    color: #333;
}



.btnBox {
    margin-top: 24px;
    display: flex;
    align-items: center !important;
    justify-content: flex-end !important;

    width: 100%;
}

.applyBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 136px;
    height: 48px;
    border-radius: 24px;
    border: 1px solid rgba(27, 178, 106, .5);
    font-family: Source Han Sans CN;
    font-weight: bold;
    font-size: 20px;
    color: #1BB26A !important;
}



.diaBox {
    width: 642px;
    // height: 362px;
    background: #FFFFFF;
    border-radius: 20px;
    font-family: Source Han Sans CN;

}

.diaBox>div:first-child {
    width: 100%;
    height: 110px;
    border-bottom: 2px solid #f2f2f2;
    text-align: center;
    font-weight: bold;
    font-size: 34px;
    color: #333333;
    line-height: 110px;
}

.infoBox {
    margin: 40px auto;
    box-sizing: border-box;
    padding: 18px 38px;
    width: 578px;
    // height: 280px;
    border-radius: 16px;
    border: 1px solid rgba(204, 204, 204, .5);

}

.infoLine {
    display: flex;
    // align-items: center;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    padding: 22px 0px;
    font-family: Source Han Sans CN;
    font-weight: 400;
    font-size: 28px;
    color: #334840;
    line-height: 64px;
}

.infoLine>span {
    font-family: Source Han Sans CN;
    font-weight: 400;
    font-size: 28px;
    color: #999999;
    line-height: 42px;
}

.diaBtnBox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 90px;
    border-top: 2px solid #f2f2f2;
}

.diaBtnBox>div {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    font-weight: bold;
    font-size: 28px;
    color: #333333;
    line-height: 64px;
}

.diaBtnBox>div:nth-child(2) {
    border-left: 2px solid #f2f2f2;
    color: #275141;
}



.itemBox {
    box-sizing: border-box;
    padding: 44px 30px 44px 44px;
    width: 100%;
    border-bottom: 2px solid #f2f2f2;
}

.itemBox>div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-family: Source Han Sans CN;
    font-weight: 400;
    font-size: 28px;
    color: #333333;
    line-height: 38px;

}

.itemBox>div:not(:first-child) {
    margin-top: 12px;
}

.itemBox>div:not(:first-child)>span {
    font-size: 24px;
    color: #999999;
}

.line1>span>span:nth-child(1) {
    color: #333;
}

.line1>span>span {
    font-size: 24px;
    color: #999999;
}

// .line1>span:nth-child(2) {
//     display: flex;
//     align-items: center;
//     justify-content: center;
//     width: 136px;
//     height: 48px;
//     border-radius: 24px;
//     border: 1px solid rgba(27, 178, 106, .5);
//     font-family: Source Han Sans CN;
//     font-weight: bold;
//     font-size: 20px;
//     color: #1BB26A;
// }


#reset /deep/ .van-nav-bar__left .van-nav-bar__text,
#reset /deep/ .van-nav-bar__right .van-nav-bar__text,
#reset /deep/ .van-nav-bar__left .van-icon {
    color: #333 !important;
}


.emptyBox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.emptyBox>img {
    margin: 40px 0;
    width: 374px;
    height: 314px;
}

.c9 {
    color: #999;
    font-size: 24px;
}

.c24 {
    color: #333;
    font-size: 24px;
}

.c24>span {
    margin-right: 20px;

}

.c3 {
    font-weight: bold;
    font-size: 24px;
}

.c31 {
    font-weight: 400;
}

.lineInfo {
    box-sizing: border-box;
    padding: 22px 26px 22px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 24px;
    color: #333;
}


.lineBox {
    margin: 0 20px;
    display: inline-block;
    content: '';
    width: 4px;
    height: 14px;
    background: #999;
    border-radius: 2px;
}
</style>